package com.bsoft.gol.hcs.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 */
public class ExecptionStackUtil {


	/**
	 * 获取异常栈字符串
	 * @param ex 异常
	 * @return
	 */
	public static String getStackError(Exception ex){
		StringWriter sw = new StringWriter();
		PrintWriter pw = new PrintWriter(sw, true);
		ex.printStackTrace(pw);
		String stackTraceString = sw.getBuffer().toString();
		return stackTraceString;
	}
}
